<?php include('view/template/common/header.tpl'); ?>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('./view/image/country.png');"><?php echo $heading_title; ?></h1>
    <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo "Lưu Lại"; ?></span></a><a onclick="location = '<?php echo $link_list; ?>';" class="button"><span><?php echo "Hủy"; ?></span></a></div>
  </div>
  <div class="content">
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
      <table class="form">
      
	<tr>
		<td>Tên bài hướng dẫn</td>
                <td><input  type="text" name="ten_huong_dan" value="<?php echo $huongdan['ten_huong_dan'];?>"/>
      			<?php if ($error_name) { ?>
          		  <span class="error"><?php echo $error_name; ?></span><?php } ?>
        	</td>
       </tr>
	
       <!--
	<tr>
		<td><?php echo "Alias"; ?></td>
                <td><input  type="text" name="alias" value="<?php echo $huongdan['alias'];?>"/>
      			<?php if ($error_name) { ?>
          		  <span class="error"><?php echo $error_name; ?></span>
                         <?php } ?>
        	</td>
       </tr>
    -->
   <td><?php echo "Loại"; ?></td>
          <td><select name="loai">
              <option value="0"><?php echo "Lựa chọn"; ?></option>
              <?php foreach ($loaihuongdan_list as $loaihuongdan) { ?>
              <?php if ($loaihuongdan['loai_huong_dan_id'] == $huongdan['loai']) { ?>
              <option value="<?php echo $loaihuongdan['loai_huong_dan_id']; ?>" selected="selected"><?php echo $loaihuongdan['ten_loai_huong_dan']; ?></option>
              <?php } else { ?>
              <option value="<?php echo $loaihuongdan['loai_huong_dan_id']; ?>"><?php echo $loaihuongdan['ten_loai_huong_dan']; ?></option>
              <?php } ?>
              <?php } ?>
            </select></td>
         </tr>
     
     
     
      <tr>
     <td><?php echo $motachitiet;?></td>
     <td><textarea name="noi_dung" id="motachitiet"><?php echo $huongdan['noi_dung'];?></textarea></td>
     </tr>
     
     </table>
    </form>
  </div><div class="bottom_button"><a onclick="$('#form').submit();" class="button"><span><?php echo "Lưu Lại"; ?></span></a><a onclick="location = '<?php echo $link_list; ?>';" class="button"><span><?php echo "Hủy"; ?></span></a></div>
</div>
<?php include('view/template/common/footer.tpl'); ?>

<script type="text/javascript">
	 var editor = CKEDITOR.replace( 'motachitiet');
        
    	 CKFinder.setupCKEditor( editor, './view/javascript/ckfinder/' ) ;
       
</script>

